<?php ini_set("memory_limit","32M"); ?>
 
 
<link href="<?=base_url()?>asset/admin/css/style.css" rel="stylesheet" type="text/css">


		 
<div id="div_laporan0" style="margin-top:20px">

	<table class="laporan" width="90%" border="1">

		<tr><td colspan="6"><b>Dinas Pendapatan Daerah Provinsi Kalimantan Timur</b></td></tr>

		<tr><td colspan="6"><b>JL. Mayjen M.T Haryono Samarinda</b></td></tr>

		<tr><td colspan="6"><b>TELP </b></td></tr>

		<tr><td colspan="6"><b></b><br/></td></tr>

		<tr><td colspan="6" div align="center"><b>LAPORAN PIUTANG PAJAK PER WILAYAH</b></td></tr>

		<tr><td colspan="6"><b>Periode : <?=$periode?></b></td></tr>

		<tr><td colspan="6"><b>Wilayah : <?=$kode_wil?> - <?=$kode_wilvalue?></b></td></tr>
		
		<tr><td colspan="6"><b>Jenis Kendaraan : <?=$jenis_kb?> - <?=$jenis_kbvalue?></b></td></tr>
		<tr>
			<th scope="col">NO</th>
			<th scope="col">WILAYAH</th>
			<th scope="col">JENIS</th>
			<th scope="col">PIUTANG PAJAK</th>
			<th scope="col">YANG SUDAH BAYAR</th>
			<th scope="col">SISA PAJAK</th> 
		</tr>

		

		<?php 
					$i=0;
					$j=0;
					$sum_piutang = 0; 
					$sum_sudah_bayar = 0; 
					$sum_sisa = 0; 
				//	$row = $getItemCount->num_rows();
					
					foreach($getItemCount->result() as $row) {$j=$j+1; } 
					$getItemCount = $j;
					//echo $getItemCount; echo '<<'; echo '<br/>';
					
					
					for($x=0;$x<=$getItemCount-1;$x++){
					
					$i = $i+1;
					//foreach($piutang->result() as $row1)echo $row1->piutang;echo'<br/>';echo'<br/>';
					//foreach($sudah_bayar->result_array() as $row2) echo $row2[1]['sudah_bayar'];echo'<br/>';
					
					$row1 = $results->result_array(); 
						//echo $x.'-'. $row1[$x]['kd_wilayah'].'-'.$row1[$x]['nm_wilayah'].'-'.$row1[$x]['kd_jenis_kb'].'-'.$row1[$x]['uraian'];  
					$row2 = $piutang->result_array(); 
						//echo $x.'-'. $row2[$x]['kd_wilayah'].'-'.$row2[$x]['kd_jenis_kb'].'-'.$row2[$x]['piutang'];  
					$row3 = $sudah_bayar->result_array();
						//echo $x.'-'. $row2[$x]['kd_wilayah'].'-'.$row2[$x]['kd_jenis_kb'].'-'. $row3[$x]['sudah_bayar'];echo'<br/>'; 
					?>
					<tr>
						<td align="left" valign="top"><?=$i?> </td>
						<td align="left" valign="top"><?=$row1[$x]['kd_wilayah'];?> - <?=$row1[$x]['nm_wilayah'];?> </td>
						<td align="left" valign="top"><?=$row1[$x]['kd_jenis_kb'];?> - <?=$row1[$x]['uraian'];?> </td>
						<td align="right" valign="top"><?=/*$row2[$x]['kd_wilayah'].'-'.$row2[$x]['kd_jenis_kb'].'-'.*/convert_rupiah_non_rp($row2[$x]['piutang']);?></td>
						<td align="right" valign="top"><?=/*$row2[$x]['kd_wilayah'].'-'.$row2[$x]['kd_jenis_kb'].'-'.*/convert_rupiah_non_rp($row3[$x]['sudah_bayar']);?> </td>
						<td align="right" valign="top"><?=convert_rupiah_non_rp(($row2[$x]['piutang']-$row3[$x]['sudah_bayar']));?> </td>
						
					</tr>	
					<?
						$sum_piutang = $sum_piutang + $row2[$x]['piutang']; 
						$sum_sudah_bayar = $sum_sudah_bayar + $row3[$x]['sudah_bayar']; 
						$sum_sisa = $sum_sisa + ($row2[$x]['piutang']-$row3[$x]['sudah_bayar']); 
					}
					?>
					<tr>
							<td colspan="3"><b>JUMLAH : </b></td> 
							<td align="right"><b><?=convert_rupiah_non_rp($sum_piutang);?></b></td>
							<td align="right"><b><?=convert_rupiah_non_rp($sum_sudah_bayar);?></b></td>
							<td align="right"><b><?=convert_rupiah_non_rp($sum_sisa);?></b></td>
							 
						</tr>	
					  
						<tr>
							<td colspan="6">&nbsp;</td>
						</tr>		
						
					
				 
					
			 	 
	</table>
 
	
</div> 
<div  >
<table class="laporan2" style="margin: 20px auto; text-align:center; border:0px ;" width="90%" border="0" align="center"> 
		<tr>
			<td>Dibuat Oleh : </td><td>Diperiksa Oleh :</td><td>Diketahui Oleh :</td>
		</tr>
		<tr>
			<td><?=$buat_jabatan?></td><td><?=$periksa_jabatan?></td><td><?=$ketahui_jabatan?></td>
		</tr>
		<tr>
			<td height="50px">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
		</tr> 
		<tr>
			<td><?=$buat_nama?></td><td><?=$periksa_nama?></td><td><?=$ketahui_nama?></td>
		</tr>
			<tr>
			<td>(<?=$buat_nip?>)</td><td>(<?=$periksa_nip?>)</td><td>(<?=$ketahui_nip?>)</td>
		</tr>
 
	</table>
 <!--
  <div  style="margin-top:30px;">
	<div  class="colx3-left" width="90%"  >
		Dibuat Oleh : <br/>
		<?=$buat_jabatan?><br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>
		<?=$buat_nama?><br/>
		(<?=$buat_nip?>)
		</div>
		
		<div  class="colx3-center" width="90%" > 
		Diperiksa Oleh : <br/>
		<?=$periksa_jabatan?><br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>
		<?=$periksa_nama?><br/>
		(<?=$periksa_nip?>)
		</div>
		
		<div  class="colx3-right" width="90%"   >
		Diketahui Oleh : <br/>
		<?=$ketahui_jabatan?><br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>
		<?=$ketahui_nama?><br/>
		(<?=$ketahui_nip?>)
		</div> 
	</div>
	-->
</div>	